using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for ThamSo
/// </summary>
public class ThamSo
{
    private string tenKieuDuLieu;
    private object giaTri;

    public string TenKieuDuLieu
    {
        get { return tenKieuDuLieu; }
        set { tenKieuDuLieu = value; }
    }

    public object GiaTri
    {
        get { return giaTri; }
        set { giaTri = value; }
    }

    public ThamSo()
    {

    }

    public ThamSo(string tenKieuDuLieu, object giaTri)
	{
        this.tenKieuDuLieu = tenKieuDuLieu;
        this.giaTri = giaTri;
	}

    public object ConvertGiaTri()
    {
        object obj = null;
        if (this.tenKieuDuLieu.Equals("int"))
        {
            obj = int.Parse(this.giaTri.ToString());
        }
        else if (this.tenKieuDuLieu.Equals("float"))
        {
            obj = float.Parse(this.giaTri.ToString());
        }
        else if (this.tenKieuDuLieu.Equals("bool"))
        {
            obj = bool.Parse(this.giaTri.ToString());
        }
        else if (this.tenKieuDuLieu.Equals("string"))
        {
            obj = this.giaTri.ToString();
        }
        return obj;
    }
}
